<tagLib name="html" />
{$header}
<div id="main" class="main" >
<!-- 主体内容  -->
<div class="content" >
  
<!--  功能组区域  -->
<div class="btn-toolbar">
      <div class="btn-group">
  <button class="btn btn-primary" onclick="add()"><i class="icon-plus icon-white"></i> 新增</button>

  <button class="btn btn-primary" onclick="charge()"><i class="icon-user icon-white"></i> 分配</button>
  <button class="btn btn-primary" onclick="tocheck()"><i class="icon-warning-sign icon-white"></i>待分配</button>
<button class="btn btn-primary" onclick="foreverdel()"><i class="icon-trash icon-white"></i> 删除</button>
</div>
<!-- 查询区域 -->
<form class="search-form pull-right" method='get' action="__URL__">
    负责人{:modList('User',$_REQUEST['charge_man'],'span2','charge_man')}
    {:configList( C('askStatus'),$_REQUEST['ask_status'],'ask_status' )}
    <input type="text" class="search-query span1" name="customer" <notempty name='_REQUEST.customer'>
        <php>echo 'value="'.urldecode($_REQUEST['customer']).'"'</php>
        <else/>
        placeholder="客户"
      </notempty> >
		<input type="text" class="search-query span4" name="keywords" <notempty name='_REQUEST.keywords'>
		<php>echo 'value="'.urldecode($_REQUEST['keywords']).'"'</php>
		<else/>
		placeholder="产品中文名，英文名，CAS号，询单号"
	</notempty>
	>
	<input type="submit" class="btn btn-primary" value="搜索"></form>
  <form class="search-form pull-right" method='get' action="__URL__">
    <input type="text" class="search-query span1" name="ask_mano" <notempty name='_REQUEST.ask_mano'>
    <php>echo 'value="'.urldecode($_REQUEST['ask_mano']).'"'</php>
    <else/>
    placeholder="搜索询价单号"
  </notempty>
  >
  <input type="submit" class="btn btn-primary" value="搜索询价单号"></form>
</div>
<!-- 功能组区域结束 -->
<php>
    function doTask($id){
    $Inquiry = M('Inquiry');
    $Inquiry->getById($id);
    $count = M('Ask_supplier')->where('inquiry_id = '.$id)->count();
    if ($count == 0 ){
      $astr = '<a href="__APP__/Ask_supplier/add/inquiry_id/'.$id;
       echo ($astr.'">发布询价任务</a>');
     }
  }

</php>
<!-- 列表显示区域  -->
<div class="list" >
   <div class="btn-toolbar">
  <div class="btn-group">
      <a href="__URL__/index" class="btn"><i class="icon-th-list"> </i>全部询单</a> 
    <a href="__URL__/index/charge_man/{:$_SESSION[C('USER_AUTH_KEY')]}" class="btn"><i class="icon-flag"> </i>我的询单</a>
    
    <?php $ods = C('askStatus'); ?>
    <foreach name="ods" item="vo">
      <a href="__URL__/index/ask_status/{$key}/charge_man/{:$_SESSION[C('USER_AUTH_KEY')]}" class="btn"><i class="icon-th-list"> </i>{$vo}</a> 
    </foreach>
    
  </div>
</div>
<div id="result" class="result none"></div><html:list id="checkList" style="table table-bordered table-striped" name="action" checkbox="true" action="true" datasource="list" show="id:编号|3%:edit,mano:询单号:edit,pname:产品,product_id|getPename:英文,product_id|getCas:CAS,number:数量,quality:质量要求,customer:客户,charge_man|getModelName=User:负责人,user_id|getModelName=User:经办人,create_time|toDate:创建时间,update_time|toDate:修改时间,id|doTask:发布询价任务,id|getAskLink:询价单,status|getConfigVal=askStatus:询价单状态" actionlist="status|showStatus=$action['id'],edit:详情:id" />
</div>
<!--  分页显示区域 -->
<div class="page">{$page}</div>
<!-- 列表显示区域结束 -->
</div>
<!-- 主体内容结束 -->
</div>
<!-- 主页面结束 --><include file="Public:footer"/>
<script type="text/javascript">
function charge(id){
    var keyValue;
    if (id)
    {
      keyValue = id;
    }else {
      keyValue = getSelectCheckboxValues();
    }
    if (!keyValue)
    {
      alert('请选择询价单！');
      return false;
    }
    location.href=URL+"/charge/id/"+keyValue;
  }
</script>

